<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<?php
  if(isset($_POST['age'])){
      $age = $_POST['age'];
      if($age>18){
          echo "您可以上网了";
      }else{
          echo "您不可以上网";
      }
  }
?>
<body>
    <form action="" method="POST">
        你几岁: <input type="text"name='age'>
        <input type="submit" value="提交">
    </form>
</body>
</html>